package sampleguiplugin;

import gamefw.framework.Coordinate;
import gamefw.uiplugin.IOutputManager;
import gamefw.uiplugin.IVisualResource;

import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;

public class SampleGUIVisualResource implements IVisualResource {
	
	private BufferedImage image;
	
	private IOutputManager outputManager;
	
	public SampleGUIVisualResource(String visualResourceName, IOutputManager outputManager)
	throws Exception {
		this.outputManager = outputManager;
		
		image = ImageIO.read(new File(visualResourceName));
	}

	@Override
	public void draw(Coordinate offset) {
		this.outputManager.draw(offset, this);
	}

	public BufferedImage getImage() {
		return image;
	}

}
